package com.shenzhen.horselive.base;

import android.content.Context;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;

import androidx.appcompat.app.AppCompatDialog;

import com.shenzhen.horselive.R;


/**
 * Author by  qianlu
 * Email : zar.l@qq.com
 * Date on 2018/12/11.
 */
public abstract class BottomDialogBase extends AppCompatDialog {


    public BottomDialogBase(Context context) {
        super(context, R.style.CommonDialog);
        init();
    }

    protected void init() {
        Window win = this.getWindow();
        win.requestFeature(Window.FEATURE_NO_TITLE);

        win.getDecorView().setPadding(0, 0, 0, 100);
        WindowManager.LayoutParams lp = win.getAttributes();
        lp.width = WindowManager.LayoutParams.MATCH_PARENT;
        lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
        lp.windowAnimations = R.style.BottomInAndOutStyle;
        getWindow().setGravity(Gravity.BOTTOM | Gravity.CENTER);
        win.setAttributes(lp);
        win.setBackgroundDrawableResource(android.R.color.transparent);


    }






}
